package com.twu.biblioteca.user;

public class User implements Comparable {

    private String libraryNumber;
    private String password;
    private String name;
    private String email;
    private String phone;

    public User(String libraryNumber, String password, String name, String email, String phone) {
        this.libraryNumber = libraryNumber;
        this.password = password;
        this.name = name;
        this.email = email;
        this.phone = phone;
    }

    public String getLibraryNumber() {
        return libraryNumber;
    }

    public String getPassword() {
        return password;
    }

    public void printUserInfo() {
        System.out.println("\n\nUSER INFORMATION\n");
        System.out.println(String.format("%-20s  :    %-15s", "Name of User", name));
        System.out.println(String.format("%-20s  :    %-15s", "Email Address", email));
        System.out.println(String.format("%-20s  :    %-15s", "Phone Number", phone));
    }

    @Override
    public int compareTo(Object object) {
        User user = (User) object;
        return this.getLibraryNumber().compareTo(user.getLibraryNumber());
    }
}
